<?php

/**
 * 项目：红河移动工程现场管理系统
 *
 * 公司：红河移动分公司
 *
 * @author 李朝应
 *
 * E-mail:lichaoying.hh@163.com
 *
 */
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Flowinfo_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }
    function insert_save_1_1_1($brid,$prname,$fsid,$uid) {
        $data = array(
               'prname' => $prname ,
               'currFsid' =>$fsid ,
               'brid' =>$brid ,
               'uid'=>$uid,
            );  
          $this->db->set('createTime','NOW()',false); 
          $this->db->set('lastUpdateTime','NOW()',false); 
          $this->db->insert('s_flowinfo', $data);
         return $this->db->insert_id();  //返回数据插入时的ID
    } 
    function update_save_1_1_1($ffid,$brid,$prname){
        $data = array(
               'prname' => $prname ,
               'brid' =>$brid ,
            );  
          $this->db->set('lastUpdateTime','NOW()',false); 
          $this->db->where("fiid", $ffid);
          $this->db->update('s_flowinfo', $data);
          return $this->db->affected_rows() ;   //执行写入操作（insert,update等）的查询后，显示被影响的行数
    }
}